#ifndef VALIDATECARD_H
#define VALIDATECARD_H

#include "card.h"
#include <QtSql>
#define MAX_NUM_EACH_COLUMN 10

class ValidateCard
{
private:
    QSqlDatabase dbConn;
    QSqlQuery    query;
    Card         InitialPark[MAX_NUM_EACH_COLUMN*2];

public:
    /**
     * @brief ValidateCard - constructor
     */
    ValidateCard();

    /**
     * @brief parkCar
     * @param card
     * @return
     */
    bool  parkCar(Card card);

    void initialNull();

    /**
     * @brief leaveCar
     * @param card
     * @return
     */
    bool  leaveCar(Card card);

    /**
     * @brief validatePark
     * @param card
     * @return
     */
    bool checkCardValidation(Card card);

    /**
     * @brief validateLeave
     * @param card
     * @return
     */
    bool  validateLeave(Card * card);

    /**
     * @brief getTakenByCardNum - get whether taken info by cardNum
     * @param cardNum
     * @return
     */
    int   getTakenByCardNum(QString cardNum);

    /**
     * @brief getCardByCardNum
     * @param cardNum
     * @return
     */
    Card* getCardByCardNum(QString cardNum);

    /**
     * @brief initialDataSource - seems like no use
     * @return
     */
    Card* initialDataSource();
};

#endif // VALIDATECARD_H
